"""
File: conftest.py
Author: ershixiong
Date: 2023/12/25
describe:
子目录下的用例无法直接使用根目录/父级目录下conftest.py里面的函数
需要 在子目录的conftest.py文件中导入根目录/父级目录下的conftest.py
from ..conftest import *

"""
import pytest

from ..conftest import *


@pytest.fixture()
def prepare_department_data(request):
    """
    :param request: 是一个fixture对象，request.param, 来获取当前参数化测试的参数值
    :return: create_data
    """
    param = request.param
    create_data = {
        "name": param[0],
        "name_en": param[1],
        "parentid": param[2],
        "order": param[3],
        "id": param[4]
    }
    return create_data


@pytest.fixture()
def prepare_user_data(request):
    """
    :param request: 是一个fixture对象，request.param, 来获取当前参数化测试的参数值
    :return: create_data
    """
    param = request.param
    create_data = {
        "name": param[0],
        "userid": param[1],
        "department": param[2],
        "mobile": param[3],
        "email": param[4]
    }
    return create_data
